package fr.iut.tp3.view.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import fr.iut.tp3.controller.commands.Commande;

public class LoginBtnListener implements ActionListener {

	private Commande authentifier;
	private Commande quitter;

	public LoginBtnListener(Commande pAuthentifier, Commande pQuitter) {
		this.authentifier = pAuthentifier;
		this.quitter = pQuitter;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getActionCommand().equals("connect")) {
			authentifier.execute();
		} else if (e.getActionCommand().equals("quit")) {
			quitter.execute();
		}
	}

}
